package com.hm.editor.adminservice.console.utils;

/**
 * @PROJECT_NAME:service_spce
 * @author:wanglei
 * @date:2020/12/22 3:40 PM
 * @Description:存储模板文件
 */
public class GridfsUtils {
//    private static final GridFsTemplate girdFs = SpringContextHelper.getBean(GridFsTemplate.class);
//    public static Object upload(String fileStr,String name){
//        return girdFs.store(new ByteArrayInputStream(fileStr.getBytes()),name).getId();
//    }
//    public static byte[] download(String id) throws IOException{
//        InputStream is = girdFs.findOne(Query.query(Criteria.where("_id").is(new ObjectId(id)))).getInputStream();
//        return IOUtils.toByteArray(is);
//    }
//    public static void delete(String id){
//        girdFs.delete(Query.query(Criteria.where("_id").is(new ObjectId(id))));
//    }
}
